package com.ecole.mines.model;

import java.util.Date;

import android.os.Parcel;
import android.os.Parcelable;

public class Cours implements Parcelable {
	
	private int id;
	private Date date;
	private Date heureDebut;
	private Date heureFin;
	private String nom;
	private String prof;
	private String salle;
	private String idGroupe;
	
	public Cours()
	{
		
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Date getHeureDebut() {
		return heureDebut;
	}
	public void setHeureDebut(Date heureDebut) {
		this.heureDebut = heureDebut;
	}
	public Date getHeureFin() {
		return heureFin;
	}
	public void setHeureFin(Date heureFin) {
		this.heureFin = heureFin;
	}
	public String getNom() {
		return nom;
	}
	public void setNom(String name) {
		this.nom = name;
	}
	public String getProf() {
		return prof;
	}
	public void setProf(String prof) {
		this.prof = prof;
	}
	public String getSalle() {
		return salle;
	}
	public void setSalle(String salle) {
		this.salle = salle;
	}
	
	public String getGroupe() {
		return idGroupe;
	}
	public void setGroupe(String groupe) {
		this.idGroupe = groupe;
	}
	
	@Override
	public int describeContents()
	{
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags)
	{
		dest.writeInt(id);
		dest.writeString(nom);
		dest.writeString(prof);
		dest.writeString(salle);
		dest.writeString(idGroupe);
		dest.writeLong(this.date.getTime());
		dest.writeLong(this.heureDebut.getTime());
		dest.writeLong(this.heureFin.getTime());
	}
	
	public Cours(Parcel in) {
		this.id = in.readInt();
		this.nom = in.readString();
		this.prof = in.readString();
		this.salle = in.readString();
		this.idGroupe = in.readString();
		this.date = new Date(in.readLong());
		this.heureDebut = new Date(in.readLong());
		this.heureFin = new Date(in.readLong());
	}

	public static final Parcelable.Creator<Cours> CREATOR = new Parcelable.Creator<Cours>() {
		@Override
		public Cours createFromParcel(Parcel source) {
			return new Cours(source);
		}

		@Override
		public Cours[] newArray(int size) {
			return new Cours[size];
		}
	};
}
